package cn.itcast.bos.dao.take_delivery;/**
 * Created with IntelliJ IDEA.
 *
 * @author: SOS
 * @create: 2018-02-26 14:24
 */

import cn.itcast.bos.domain.take_delivery.Promotion;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.Date;

/**
 * @program: ideabos2.0
 * @description: 宣传任务的持久层
 * @author: SOS
 * @create: 2018-02-26 14:24
 **/
@Repository
public interface PromotionRepository extends JpaRepository<Promotion,Integer>,
        JpaSpecificationExecutor<Promotion> {


    @Query(value = "update Promotion set status = '2' where status = '1' and endDate< ?")
    @Modifying
    void updateStatus(Date date);

}
